-
-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/post new measurements #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@jona159 , per our conversation I am adding summary of our discussion. I tested data upload presented in this PR via senseBox:bike app.
error 422: {"code":"UnprocessableEntity","message":"Cannot read properties of undefined (reading 'decodeMessage')"} Cursor suggested the following fix, that worked for me locally Issue:Measurement upload failing with: "Cannot read properties of undefined (reading 'decodeMessage')" Root Cause:The decoder lookup was failing when content-type included charset (e.g., "application/json; charset=utf-8") Fix:Modified one file: app/lib/decoding-service.server.ts Added a normalization function and updated the decoder lookup:
Please let me know, if any furhter testing is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do get the reason why you chose to do it, but I would prefer sticking to the convention of naming our api tests the same as the route.
Aka if we test api.boxes.$deviceId.$sensorId.ts the test should be named api.boxes.$deviceId.$sensorId.spec.ts.
This keeps the files a little shorter and separates the concerns nicely, letting everyone involved find what they search for (hopefully). Approach-wise this is probably considered more of an integration than a unit test.
If you want to add unit tests, I 'd say we move it out of the routes/ folder.
Does that make sense?
No description provided.